home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / fileutil / tar-1.12.tar.gz / tar-1.12.tar / tar-1.12 / configure.in < prev    next >
Text File  |  1997-04-25  |  7KB  |  216 lines

  1. # Configure template for GNU tar.
  2. # Copyright (C) 1991, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
  3. # Process this file with autoconf to produce a configure script.
  4.  
  5. AC_INIT(src/tar.c)
  6. AM_CONFIG_HEADER(config.h)
  7. AC_PREREQ(2.12)
  8. AM_INIT_AUTOMAKE(tar, 1.12)
  9. AC_DEFINE(_GNU_SOURCE)
  10. ALL_LINGUAS="de fr it ko nl no pl pt sl sv"
  11.  
  12. fp_PROG_ECHO
  13. test $fp_cv_prog_echo_nonl = no \
  14.   && echo 2>&1 "WARNING: \`echo' not powerful enough for \`make check'"
  15. AC_PROG_CC
  16. AC_PROG_GCC_TRADITIONAL
  17. AC_AIX
  18. AC_MINIX
  19. AC_PROG_RANLIB
  20. AC_PROG_YACC
  21.  
  22. AC_ISC_POSIX
  23. AM_C_PROTOTYPES
  24. AC_C_CONST
  25. AC_C_INLINE
  26. AC_CHECK_SIZEOF(unsigned long, 4)
  27. AC_CHECK_SIZEOF(long long, 0)
  28.  
  29. AC_CHECK_HEADERS(fcntl.h limits.h linux/fd.h memory.h net/errno.h poll.h \
  30. sgtty.h string.h stropts.h \
  31. sys/buf.h sys/device.h sys/gentape.h sys/inet.h sys/io/trioctl.h sys/ioccom.h \
  32. sys/mtio.h sys/param.h sys/tprintf.h sys/tape.h sys/time.h sys/timeb.h \
  33. sys/wait.h unistd.h)
  34.  
  35. # It seems that that many machines where <utime.h> seems to be
  36. # broken just require something like -D_XXX_SOURCE, where XXX might
  37. # be POSIX, POSIX_C, ALL, HPUX or whatever, depending on the machine.
  38.  
  39. AC_CACHE_CHECK(for utime.h, tar_cv_header_utime_h,
  40.   [AC_TRY_COMPILE([
  41. #include <sys/types.h>
  42. #include <utime.h>], [struct utimbuf foo],
  43.   tar_cv_header_utime_h=yes, tar_cv_header_utime_h=no)])
  44. test $tar_cv_header_utime_h = yes && AC_DEFINE(HAVE_UTIME_H)
  45.  
  46. if test $ac_cv_header_sys_mtio_h = yes; then
  47.   AC_CACHE_CHECK(for remote tape header files, tar_cv_header_rmt,
  48.     [AC_TRY_CPP([
  49. #if HAVE_SGTTY_H
  50. # include <sgtty.h>
  51. #endif
  52. #include <sys/socket.h>],
  53.     tar_cv_header_rmt=yes, tar_cv_header_rmt=no)])
  54.   test $tar_cv_header_rmt = yes && RMT=rmt
  55.   AC_SUBST(RMT)
  56. fi
  57.  
  58. AC_CACHE_CHECK(for getgrgid declaration, tar_cv_header_getgrgid,
  59.   [AC_EGREP_HEADER(getgrgid, grp.h,
  60.   tar_cv_header_getgrgid=yes, tar_cv_header_getgrgid=no)])
  61. test $tar_cv_header_getgrgid = yes && AC_DEFINE(HAVE_GETGRGID)
  62.  
  63. AC_CACHE_CHECK(for getpwuid declaration, tar_cv_header_getpwuid,
  64.   [AC_EGREP_HEADER(getpwuid, pwd.h,
  65.   tar_cv_header_getpwuid=yes, tar_cv_header_getpwuid=no)])
  66. test $tar_cv_header_getpwuid = yes && AC_DEFINE(HAVE_GETPWUID)
  67.  
  68. AC_CACHE_CHECK(which ioctl field to test for reversed bytes,
  69.   tar_cv_header_mtio_check_field,
  70.   [AC_EGREP_HEADER(mt_model, sys/mtio.h,
  71.   tar_cv_header_mtio_check_field=mt_model,
  72.   tar_cv_header_mtio_check_field=mt_type)])
  73. AC_DEFINE_UNQUOTED(MTIO_CHECK_FIELD, $tar_cv_header_mtio_check_field)
  74.  
  75. AC_HEADER_DIRENT
  76. AC_HEADER_MAJOR
  77. AC_HEADER_STAT
  78. AC_HEADER_STDC
  79. AC_HEADER_TIME
  80. AC_STRUCT_ST_BLKSIZE
  81. AC_STRUCT_ST_BLOCKS
  82. AC_TYPE_SIGNAL
  83. AC_TYPE_SIZE_T
  84. AC_TYPE_UID_T
  85.  
  86. AC_CHECK_FUNCS(fsync ftime getcwd isascii lchown mkfifo nap napms poll \
  87. select strerror strstr usleep)
  88.  
  89. AC_CACHE_CHECK(for mknod, tar_cv_func_mknod,
  90.   [AC_TRY_LINK([
  91. #include <sys/types.h>
  92. #include <sys/stat.h>],
  93.   [mknod (0, 0, 0)],
  94.   tar_cv_func_mknod=yes, tar_cv_func_mknod=no)])
  95. test $tar_cv_func_mknod = yes && AC_DEFINE(HAVE_MKNOD)
  96.  
  97. # Whenever both -lsocket and -lnsl are needed, it seems to be always the
  98. # case that gethostbyname requires -lnsl.  So, check -lnsl first, for it
  99. # to be in LIBS before the setsockopt checks are performed.  *However*,
  100. # on SINIX-N 5.43, this is false, and gethostent seems to be a better
  101. # candidate. So, let's use it below instead of gethostbyname, and see.
  102.  
  103. AC_CHECK_FUNC(gethostent)
  104. if test $ac_cv_func_gethostent = no; then
  105.   AC_CHECK_LIB(nsl, gethostent)
  106. fi
  107. AC_CHECK_FUNC(setsockopt)
  108. if test $ac_cv_func_setsockopt = no; then
  109.   AC_CHECK_LIB(socket, setsockopt)
  110. fi
  111.  
  112. AC_FUNC_ALLOCA
  113. AC_FUNC_FNMATCH
  114. test $ac_cv_func_fnmatch_works = yes || LIBOBJS="$LIBOBJS fnmatch.o"
  115. AC_FUNC_VPRINTF
  116. AC_REPLACE_FUNCS(basename dirname execlp ftruncate memset mkdir rename rmdir)
  117. test "$ac_cv_func_strstr" = yes || LIBOBJS="$LIBOBJS strstr.o"
  118.  
  119. # The 3-argument open happens to go along with the O_* defines, which
  120. # are easier to check for.
  121.  
  122. AC_CACHE_CHECK(for 3-argument open, tar_cv_func_open3,
  123.   [AC_TRY_COMPILE([
  124. #if HAVE_FCNTL_H
  125. # include <fcntl.h>
  126. #else
  127. # include <sys/file.h>
  128. #endif],
  129.   [int x = O_RDONLY],
  130.   tar_cv_func_open3=yes, tar_cv_func_open3=no)])
  131. if test $tar_cv_func_open3 = no; then
  132.   AC_DEFINE(EMUL_OPEN3)
  133. fi
  134.  
  135. # `union wait' is preferrably avoided.  We merely assume below
  136. # that if `int pid;' fails, `union wait pid;' would have worked.
  137. # Directly trying `union wait pid;' is seeking for trouble, as
  138. # some POSIX systems are offering compatibility hacks generating
  139. # ugly diagnostics.  Also, on some systems, WEXITSTATUS exists,
  140. # but fails when called on `union wait' variables.
  141.  
  142. AC_CACHE_CHECK(for union wait, tar_cv_header_union_wait,
  143.   [AC_TRY_COMPILE([
  144. #include <sys/types.h>
  145. #if HAVE_SYS_WAIT_H
  146. # include <sys/wait.h>
  147. #endif],
  148.   [int status; int pid; pid = wait (&status);],
  149.   tar_cv_header_union_wait=no, tar_cv_header_union_wait=yes)])
  150. test $tar_cv_header_union_wait = yes && AC_DEFINE(HAVE_UNION_WAIT)
  151.  
  152. AC_CACHE_CHECK(for remote shell, tar_cv_path_RSH,
  153.   [if test -n "$RSH"; then
  154.     tar_cv_path_RSH=$RSH
  155.   else
  156.     tar_cv_path_RSH=no
  157.     for ac_file in /usr/ucb/rsh /usr/bin/remsh /usr/bin/rsh /usr/bsd/rsh \
  158.       /usr/bin/nsh /usr/bin/rcmd
  159.     do
  160.       if test -f $ac_file; then
  161.         tar_cv_path_RSH=$ac_file
  162.         break
  163.       fi
  164.     done
  165.   fi])
  166. if test $tar_cv_path_RSH = no; then
  167.   AC_CHECK_HEADERS(netdb.h)
  168. else
  169.   AC_DEFINE_UNQUOTED(REMOTE_SHELL, "$tar_cv_path_RSH")
  170. fi
  171.  
  172. AC_MSG_CHECKING(for default archive)
  173.  
  174. if test -z "$DEFAULT_ARCHIVE"; then
  175.   DEFAULT_ARCHIVE=-
  176. else
  177.   if test -z "`ls $DEFAULT_ARCHIVE 2>/dev/null`"; then
  178.     AC_MSG_WARN(DEFAULT_ARCHIVE \`$DEFAULT_ARCHIVE' not found on this system)
  179.   fi
  180.   # FIXME: Look for DEFTAPE in <sys/mtio.h>.
  181.   # FIXME: Let DEVICE_PREFIX be configured from the environment.
  182.   # FIXME: Rearrange, here.
  183.   case $DEFAULT_ARCHIVE in
  184. changequote(, )dnl
  185.     *[0-7][lmh])
  186.       device_prefix=`echo $DEFAULT_ARCHIVE | sed 's/[0-7][lmh]$//'`
  187. changequote([, ])dnl
  188.       AC_DEFINE_UNQUOTED(DEVICE_PREFIX, "$device_prefix")
  189.       AC_DEFINE(DENSITY_LETTER)
  190.       ;;
  191. changequote(, )dnl
  192.     *[0-7])
  193.       device_prefix=`echo $DEFAULT_ARCHIVE | sed 's/[0-7]$//'`
  194. changequote([, ])dnl
  195.       AC_DEFINE_UNQUOTED(DEVICE_PREFIX, "$device_prefix")
  196.       ;;
  197.   esac
  198. fi
  199. AC_DEFINE_UNQUOTED(DEFAULT_ARCHIVE, "$DEFAULT_ARCHIVE")
  200. AC_MSG_RESULT($DEFAULT_ARCHIVE)
  201.  
  202. AC_MSG_CHECKING(for default blocking)
  203. DEFAULT_BLOCKING=${DEFAULT_BLOCKING-20}
  204. AC_DEFINE_UNQUOTED(DEFAULT_BLOCKING, $DEFAULT_BLOCKING)
  205. AC_MSG_RESULT($DEFAULT_BLOCKING)
  206.  
  207. fp_WITH_INCLUDED_MALLOC
  208. AM_WITH_DMALLOC
  209.  
  210. AM_GNU_GETTEXT
  211. AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
  212.  
  213. AC_OUTPUT([Makefile doc/Makefile intl/Makefile lib/Makefile po/Makefile.in \
  214. scripts/Makefile src/Makefile tests/Makefile tests/preset],
  215. [sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile])
  216.